import request from '@/config/axios'

export interface MaWeightRulesVO {
  id: string,
  type: string,
  upperWeight: number,
  lowerWeight: number
}


// 查询
export const getMaWeightRules = (params: PageParam) => {
  return request.get({ url: '/project/weight-threshold-manage/page', params })
}

// 修改/新增阈值
export const createMaWeightRules = (data: MaWeightRulesVO) => {
  return request.post({ url: '/project/weight-threshold-manage/save', data })
}

// 删除阈值
export const deleteMaWeightRules = (id: string) => {
  return request.delete({ url: '/project/weight-threshold-manage/delete?id=' + id  })
}

// 查询产品型号
export const getProductModel = (params: string) => {
  return request.get({ url: '/project/kis-bom/typeList?type='+ params })
}

// 查询产品型号
export const getMaWeight = (id: string) => {
  return request.get({ url: '/project/weight-threshold-manage/get?id='+ id })
}

